bitkeeper revision 1.1389.5.35 (427e00b2juTv-JMiPdIYinvwaH2N8Q)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 8 May 2005 12:06:10 +0000 (12:06 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Sun, 8 May 2005 12:06:10 +0000 (12:06 +0000)
Field-name cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
27 files changed:
xen/arch/ia64/domain.c
xen/arch/ia64/idle0_task.c
xen/arch/ia64/xenmisc.c
xen/arch/ia64/xensetup.c
xen/arch/x86/dom0_ops.c
xen/arch/x86/domain.c
xen/arch/x86/domain_build.c
xen/arch/x86/i387.c
xen/arch/x86/idle0_task.c
xen/arch/x86/mm.c
xen/arch/x86/physdev.c
xen/arch/x86/setup.c
xen/arch/x86/shadow.c
xen/arch/x86/smpboot.c
xen/arch/x86/traps.c
xen/common/dom0_ops.c
xen/common/domain.c
xen/common/event_channel.c
xen/common/keyhandler.c
xen/common/page_alloc.c
xen/common/sched_bvt.c
xen/common/schedule.c
xen/include/asm-x86/config.h
xen/include/asm-x86/debugger.h
xen/include/asm-x86/i387.h
xen/include/xen/event.h
xen/include/xen/sched.h

index 9f0d9d20ba18817222ca164deba7537463d36fe2..19a608e1ac6580568caa37da69ff6b01640d267b 100644 (file)
@@ -626,7 +626,7 @@ int construct_dom0(struct domain *d,
 #ifndef CLONE_DOMAIN0
        if ( d != dom0 ) 
            BUG();
-       if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) 
+       if ( test_bit(DF_CONSTRUCTED, &d->flags) ) 
            BUG();
 #endif
 
@@ -753,7 +753,7 @@ int construct_dom0(struct domain *d,
 #endif
        console_endboot(strstr(cmdline, "tty0") != NULL);
 
-       set_bit(DF_CONSTRUCTED, &d->d_flags);
+       set_bit(DF_CONSTRUCTED, &d->flags);
 
        new_thread(ed, pkern_entry, 0, 0);
        // FIXME: Hack for keyboard input
@@ -783,7 +783,7 @@ int construct_domU(struct domain *d,
        unsigned long pkern_entry;
 
 #ifndef DOMU_AUTO_RESTART
-       if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) BUG();
+       if ( test_bit(DF_CONSTRUCTED, &d->flags) ) BUG();
 #endif
 
        printk("*** LOADING DOMAIN %d ***\n",d->id);
@@ -816,7 +816,7 @@ int construct_domU(struct domain *d,
        loaddomainelfimage(d,image_start);
        printk("loaddomainelfimage returns\n");
 
-       set_bit(DF_CONSTRUCTED, &d->d_flags);
+       set_bit(DF_CONSTRUCTED, &d->flags);
 
        printk("calling new_thread, entry=%p\n",pkern_entry);
 #ifdef DOMU_AUTO_RESTART
index b7523ea502087f0a34fb416458d10c859129e072..4bc636ae6ea7c78e0bbe4293efb725361fb48428 100644 (file)
@@ -22,7 +22,7 @@
 #define IDLE0_DOMAIN(_t)             \
 {                                    \
     id:          IDLE_DOMAIN_ID,     \
-    d_flags:     1<<DF_IDLETASK,     \
+    flags:     1<<DF_IDLETASK,       \
     refcnt:      ATOMIC_INIT(1)      \
 }
 
index 8d94e3f53634e33c2a6c91a6945143ce99f04bf8..59a2ebc7395c44dc24d340f48a536b2e0e19d609 100644 (file)
@@ -240,7 +240,7 @@ int id = ((struct exec_domain *)current)->domain->id & 0xf;
 if (!cnt[id]--) { printk("%x",id); cnt[id] = 50; }
 if (!i--) { printk("+",id); cnt[id] = 100; }
 }
-       clear_bit(EDF_RUNNING, &prev->ed_flags);
+       clear_bit(EDF_RUNNING, &prev->flags);
        //if (!is_idle_task(next->domain) )
                //send_guest_virq(next, VIRQ_TIMER);
        load_region_regs(current);
@@ -270,7 +270,7 @@ loop:
        printf(buf);
        if (regs) show_registers(regs);
        domain_pause_by_systemcontroller(current->domain);
-       set_bit(DF_CRASHED, ed->domain->d_flags);
+       set_bit(DF_CRASHED, ed->domain->flags);
        if (ed->domain->id == 0) {
                int i = 1000000000L;
                // if domain0 crashes, just periodically print out panic
index 7d497ea40c7e1ce3c8f5a962750ea6955f563ddc..ec864e1ef25a064de674e7662908ad44c213bedb 100644 (file)
@@ -267,7 +267,7 @@ printk("About to call init_idle_task()\n");
     if ( dom0 == NULL )
         panic("Error creating domain 0\n");
 
-    set_bit(DF_PRIVILEGED, &dom0->d_flags);
+    set_bit(DF_PRIVILEGED, &dom0->flags);
 
     /*
      * We're going to setup domain0 using the module(s) that we stashed safely
index 722317b6980793b2141911716aedc26c7b87dbdd..a3251368cef63ec52949ce97f40dac3e63119c26 100644 (file)
@@ -397,7 +397,7 @@ void arch_getdomaininfo_ctxt(
 #endif
 
     c->flags = 0;
-    if ( test_bit(EDF_DONEFPUINIT, &ed->ed_flags) )
+    if ( test_bit(EDF_DONEFPUINIT, &ed->flags) )
         c->flags |= VGCF_I387_VALID;
     if ( KERNEL_MODE(ed, &ed->arch.guest_context.user_regs) )
         c->flags |= VGCF_IN_KERNEL;
index 3d275206b45348ffd7df05985e201b28a8942adb..a3fdcaf1bfc259215ee8fa0bc8cdd009df9b8872 100644 (file)
@@ -252,7 +252,7 @@ void arch_do_createdomain(struct exec_domain *ed)
 
         d->shared_info = (void *)alloc_xenheap_page();
         memset(d->shared_info, 0, PAGE_SIZE);
-        ed->vcpu_info = &d->shared_info->vcpu_data[ed->eid];
+        ed->vcpu_info = &d->shared_info->vcpu_data[ed->id];
         SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d);
         machine_to_phys_mapping[virt_to_phys(d->shared_info) >> 
                                PAGE_SHIFT] = INVALID_M2P_ENTRY;
@@ -294,7 +294,7 @@ void arch_do_boot_vcpu(struct exec_domain *ed)
     struct domain *d = ed->domain;
     ed->arch.schedule_tail = d->exec_domain[0]->arch.schedule_tail;
     ed->arch.perdomain_ptes = 
-        d->arch.mm_perdomain_pt + (ed->eid << PDPT_VCPU_SHIFT);
+        d->arch.mm_perdomain_pt + (ed->id << PDPT_VCPU_SHIFT);
     ed->arch.flags = TF_kernel_mode;
 }
 
@@ -397,9 +397,9 @@ int arch_set_info_guest(
                 return -EINVAL;
     }
 
-    clear_bit(EDF_DONEFPUINIT, &ed->ed_flags);
+    clear_bit(EDF_DONEFPUINIT, &ed->flags);
     if ( c->flags & VGCF_I387_VALID )
-        set_bit(EDF_DONEFPUINIT, &ed->ed_flags);
+        set_bit(EDF_DONEFPUINIT, &ed->flags);
 
     ed->arch.flags &= ~TF_kernel_mode;
     if ( c->flags & VGCF_IN_KERNEL )
@@ -415,7 +415,7 @@ int arch_set_info_guest(
     if ( !IS_PRIV(d) )
         ed->arch.guest_context.user_regs.eflags &= 0xffffcfff;
 
-    if ( test_bit(EDF_DONEINIT, &ed->ed_flags) )
+    if ( test_bit(EDF_DONEINIT, &ed->flags) )
         return 0;
 
     if ( (rc = (int)set_fast_trap(ed, c->fast_trap_idx)) != 0 )
@@ -426,7 +426,7 @@ int arch_set_info_guest(
     for ( i = 0; i < 8; i++ )
         (void)set_debugreg(ed, i, c->debugreg[i]);
 
-    if ( ed->eid == 0 )
+    if ( ed->id == 0 )
         d->vm_assist = c->vm_assist;
 
     phys_basetab = c->pt_base;
@@ -478,7 +478,7 @@ int arch_set_info_guest(
     update_pagetables(ed);
     
     /* Don't redo final setup */
-    set_bit(EDF_DONEINIT, &ed->ed_flags);
+    set_bit(EDF_DONEINIT, &ed->flags);
 
     return 0;
 }
@@ -796,7 +796,7 @@ void context_switch(struct exec_domain *prev, struct exec_domain *next)
      * 'prev' (after this point, a dying domain's info structure may be freed
      * without warning). 
      */
-    clear_bit(EDF_RUNNING, &prev->ed_flags);
+    clear_bit(EDF_RUNNING, &prev->flags);
 
     schedule_tail(next);
     BUG();
index 5a82ac60eb56878f7f08f9e06b00398087a5ca94..5c650f468821a92ae70855325a7ef3de514547e1 100644 (file)
@@ -114,7 +114,7 @@ int construct_dom0(struct domain *d,
     /* Sanity! */
     if ( d->id != 0 ) 
         BUG();
-    if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) 
+    if ( test_bit(DF_CONSTRUCTED, &d->flags) ) 
         BUG();
 
     memset(&dsi, 0, sizeof(struct domain_setup_info));
@@ -540,7 +540,7 @@ int construct_dom0(struct domain *d,
     /* DOM0 gets access to everything. */
     physdev_init_dom0(d);
 
-    set_bit(DF_CONSTRUCTED, &d->d_flags);
+    set_bit(DF_CONSTRUCTED, &d->flags);
 
     new_thread(ed, dsi.v_kernentry, vstack_end, vstartinfo_start);
 
index 08dc9fdcb73b995c9ac846d5ba511f9a0edfd71e..af54d0af8a1d62e76634ac5cc5b4769f077dd9df 100644 (file)
@@ -18,7 +18,7 @@ void init_fpu(void)
     __asm__ __volatile__ ( "fninit" );
     if ( cpu_has_xmm )
         load_mxcsr(0x1f80);
-    set_bit(EDF_DONEFPUINIT, &current->ed_flags);
+    set_bit(EDF_DONEFPUINIT, &current->flags);
 }
 
 void save_init_fpu(struct exec_domain *tsk)
@@ -28,7 +28,7 @@ void save_init_fpu(struct exec_domain *tsk)
      * This causes us to set the real flag, so we'll need
      * to temporarily clear it while saving f-p state.
      */
-    if ( test_bit(EDF_GUEST_STTS, &tsk->ed_flags) )
+    if ( test_bit(EDF_GUEST_STTS, &tsk->flags) )
         clts();
 
     if ( cpu_has_fxsr )
@@ -40,7 +40,7 @@ void save_init_fpu(struct exec_domain *tsk)
             "fnsave %0 ; fwait"
             : "=m" (tsk->arch.guest_context.fpu_ctxt) );
 
-    clear_bit(EDF_USEDFPU, &tsk->ed_flags);
+    clear_bit(EDF_USEDFPU, &tsk->flags);
     stts();
 }
 
index 71fbc34dd6c446a4af28a88852a3fe390063b1fb..43c0c31c2585ad758a9f5d01462f895bc5d26493 100644 (file)
@@ -5,7 +5,7 @@
 
 struct domain idle0_domain = {
     id:          IDLE_DOMAIN_ID,
-    d_flags:     1<<DF_IDLETASK,
+    flags:       1<<DF_IDLETASK,
     refcnt:      ATOMIC_INIT(1)
 };
 
index 43d2d2daea57c56cca28ecbb1295973919d55186..0f881be8d495032dfecde6509962d61331eea1d2 100644 (file)
@@ -1142,7 +1142,7 @@ void put_page_type(struct pfn_info *page)
          * See domain.c:relinquish_list().
          */
         ASSERT((x & PGT_validated) || 
-               test_bit(DF_DYING, &page_get_owner(page)->d_flags));
+               test_bit(DF_DYING, &page_get_owner(page)->flags));
 
         if ( unlikely((nx & PGT_count_mask) == 0) )
         {
@@ -1691,13 +1691,13 @@ int do_mmuext_op(
              * it is dying. 
              */
             ASSERT(e->tot_pages <= e->max_pages);
-            if ( unlikely(test_bit(DF_DYING, &e->d_flags)) ||
+            if ( unlikely(test_bit(DF_DYING, &e->flags)) ||
                  unlikely(e->tot_pages == e->max_pages) ||
                  unlikely(IS_XEN_HEAP_FRAME(page)) )
             {
                 MEM_LOG("Transferee has no reservation headroom (%d,%d), or "
                         "page is in Xen heap (%lx), or dom is dying (%ld).\n",
-                        e->tot_pages, e->max_pages, op.mfn, e->d_flags);
+                        e->tot_pages, e->max_pages, op.mfn, e->flags);
                 okay = 0;
                 goto reassign_fail;
             }
@@ -2776,7 +2776,7 @@ int ptwr_do_page_fault(struct domain *d, unsigned long addr)
      * If this is a multi-processor guest then ensure that the page is hooked
      * into at most one L2 table, which must be the one running on this VCPU.
      */
-    if ( (d->exec_domain[0]->ed_next_list != NULL) &&
+    if ( (d->exec_domain[0]->next_in_list != NULL) &&
          ((page->u.inuse.type_info & PGT_count_mask) != 
           (!!(page->u.inuse.type_info & PGT_pinned) +
            (which == PTWR_PT_ACTIVE))) )
@@ -2945,13 +2945,13 @@ void ptwr_destroy(struct domain *d)
          * Also, a domain mustn't have PGC_allocated pages when it is dying.
          */
         ASSERT(e->tot_pages <= e->max_pages);
-        if ( unlikely(test_bit(DF_DYING, &e->d_flags)) ||
+        if ( unlikely(test_bit(DF_DYING, &e->flags)) ||
              unlikely(e->tot_pages == e->max_pages) ||
              unlikely(!gnttab_prepare_for_transfer(e, d, gntref)) )
         {
             MEM_LOG("Transferee has no reservation headroom (%d,%d), or "
                     "provided a bad grant ref, or is dying (%p).\n",
-                    e->tot_pages, e->max_pages, e->d_flags);
+                    e->tot_pages, e->max_pages, e->flags);
             spin_unlock(&e->page_alloc_lock);
             put_domain(e);
             okay = 0;
index 9e47826998f7e851d52f87ec9a2c0b34bae06346..66e0ed1251eb962d9540f54742bcf635d9184231 100644 (file)
@@ -130,7 +130,7 @@ void physdev_init_dom0(struct domain *d)
     BUG_ON(d->arch.iobmp_mask == NULL);
     memset(d->arch.iobmp_mask, 0, IOBMP_BYTES);
 
-    set_bit(DF_PHYSDEV, &d->d_flags);
+    set_bit(DF_PHYSDEV, &d->flags);
 }
 
 
index 8b8f8182e0f9690ceac5559f18bbbdabee65c460..37cc2c46844c5fbf636b6ce401e5f577006ca371 100644 (file)
@@ -581,7 +581,7 @@ void __init __start_xen(multiboot_info_t *mbi)
     if ( dom0 == NULL )
         panic("Error creating domain 0\n");
 
-    set_bit(DF_PRIVILEGED, &dom0->d_flags);
+    set_bit(DF_PRIVILEGED, &dom0->flags);
 
     /* Grab the DOM0 command line. Skip past the image name. */
     cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL);
index 3651d9c9aad9f2c021dfa505a57e014bf32e8b5b..6d8a8490050e33480db0219e79797836c19887c1 100644 (file)
@@ -1120,7 +1120,7 @@ void __shadow_mode_disable(struct domain *d)
      * Currently this does not fix up page ref counts, so it is valid to call
      * only when a domain is being destroyed.
      */
-    BUG_ON(!test_bit(DF_DYING, &d->d_flags));
+    BUG_ON(!test_bit(DF_DYING, &d->flags));
     d->arch.shadow_tainted_refcnts = 1;
 
     free_shadow_pages(d);
index a992045be21786d1890a1a4831dc53d406d65e8f..981a36d97d499013e33b1a69e9b72561e65bca0e 100644 (file)
@@ -658,7 +658,7 @@ static void __init do_boot_cpu (int apicid)
 
     ed = idle->exec_domain[0];
 
-    set_bit(DF_IDLETASK, &idle->d_flags);
+    set_bit(DF_IDLETASK, &idle->flags);
 
     ed->arch.monitor_table = mk_pagetable(__pa(idle_pg_table));
 
index 3c5cc07c0caf51282a1ad70fbf0d6791146b392e..f242333c8d7fb7d34e7def1f3f95057850f5aa60 100644 (file)
@@ -361,13 +361,13 @@ long do_fpu_taskswitch(int set)
 
     if ( set )
     {
-        set_bit(EDF_GUEST_STTS, &ed->ed_flags);
+        set_bit(EDF_GUEST_STTS, &ed->flags);
         stts();
     }
     else
     {
-        clear_bit(EDF_GUEST_STTS, &ed->ed_flags);
-        if ( test_bit(EDF_USEDFPU, &ed->ed_flags) )
+        clear_bit(EDF_GUEST_STTS, &ed->flags);
+        if ( test_bit(EDF_USEDFPU, &ed->flags) )
             clts();
     }
 
@@ -665,7 +665,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs)
         case 0: /* Read CR0 */
             *reg = 
                 (read_cr0() & ~X86_CR0_TS) | 
-                (test_bit(EDF_GUEST_STTS, &ed->ed_flags) ? X86_CR0_TS : 0);
+                (test_bit(EDF_GUEST_STTS, &ed->flags) ? X86_CR0_TS : 0);
             break;
 
         case 2: /* Read CR2 */
@@ -919,15 +919,15 @@ asmlinkage int math_state_restore(struct cpu_user_regs *regs)
     /* Prevent recursion. */
     clts();
 
-    if ( !test_and_set_bit(EDF_USEDFPU, &current->ed_flags) )
+    if ( !test_and_set_bit(EDF_USEDFPU, &current->flags) )
     {
-        if ( test_bit(EDF_DONEFPUINIT, &current->ed_flags) )
+        if ( test_bit(EDF_DONEFPUINIT, &current->flags) )
             restore_fpu(current);
         else
             init_fpu();
     }
 
-    if ( test_and_clear_bit(EDF_GUEST_STTS, &current->ed_flags) )
+    if ( test_and_clear_bit(EDF_GUEST_STTS, &current->flags) )
     {
         struct trap_bounce *tb = &current->arch.trap_bounce;
         tb->flags = TBF_EXCEPTION;
index 750eb14813789c8a80d5e873610b3961f6c2c64b..23fc589d4dc2aa15acffde4156c7f80503e2229c 100644 (file)
@@ -139,7 +139,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
         {
             ret = -EINVAL;
             if ( (d != current->domain) && 
-                 test_bit(DF_CONSTRUCTED, &d->d_flags) )
+                 test_bit(DF_CONSTRUCTED, &d->flags) )
             {
                 domain_unpause_by_systemcontroller(d);
                 ret = 0;
@@ -246,14 +246,14 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
 
         if ( cpu == -1 )
         {
-            clear_bit(EDF_CPUPINNED, &ed->ed_flags);
+            clear_bit(EDF_CPUPINNED, &ed->flags);
         }
         else
         {
             exec_domain_pause(ed);
             if ( ed->processor != (cpu % smp_num_cpus) )
-                set_bit(EDF_MIGRATED, &ed->ed_flags);
-            set_bit(EDF_CPUPINNED, &ed->ed_flags);
+                set_bit(EDF_MIGRATED, &ed->flags);
+            set_bit(EDF_CPUPINNED, &ed->flags);
             ed->processor = cpu % smp_num_cpus;
             exec_domain_unpause(ed);
         }
@@ -311,12 +311,12 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
         ed = d->exec_domain[op->u.getdomaininfo.exec_domain];
 
         op->u.getdomaininfo.flags =
-            (test_bit( DF_DYING,      &d->d_flags)  ? DOMFLAGS_DYING    : 0) |
-            (test_bit( DF_CRASHED,    &d->d_flags)  ? DOMFLAGS_CRASHED  : 0) |
-            (test_bit( DF_SHUTDOWN,   &d->d_flags)  ? DOMFLAGS_SHUTDOWN : 0) |
-            (test_bit(EDF_CTRLPAUSE, &ed->ed_flags) ? DOMFLAGS_PAUSED   : 0) |
-            (test_bit(EDF_BLOCKED,   &ed->ed_flags) ? DOMFLAGS_BLOCKED  : 0) |
-            (test_bit(EDF_RUNNING,   &ed->ed_flags) ? DOMFLAGS_RUNNING  : 0);
+            (test_bit( DF_DYING,      &d->flags)  ? DOMFLAGS_DYING    : 0) |
+            (test_bit( DF_CRASHED,    &d->flags)  ? DOMFLAGS_CRASHED  : 0) |
+            (test_bit( DF_SHUTDOWN,   &d->flags)  ? DOMFLAGS_SHUTDOWN : 0) |
+            (test_bit(EDF_CTRLPAUSE, &ed->flags) ? DOMFLAGS_PAUSED   : 0) |
+            (test_bit(EDF_BLOCKED,   &ed->flags) ? DOMFLAGS_BLOCKED  : 0) |
+            (test_bit(EDF_RUNNING,   &ed->flags) ? DOMFLAGS_RUNNING  : 0);
 
         op->u.getdomaininfo.flags |= ed->processor << DOMFLAGS_CPUSHIFT;
         op->u.getdomaininfo.flags |= 
index 253a6b102be1cbed29f849ee8ba9f502603ee6b7..7ab17768c6212f9aac94f8a7873f1e36449a68cb 100644 (file)
@@ -66,12 +66,12 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
     {
         write_lock(&domlist_lock);
         pd = &domain_list; /* NB. domain_list maintained in order of dom_id. */
-        for ( pd = &domain_list; *pd != NULL; pd = &(*pd)->next_list )
+        for ( pd = &domain_list; *pd != NULL; pd = &(*pd)->next_in_list )
             if ( (*pd)->id > d->id )
                 break;
-        d->next_list = *pd;
+        d->next_in_list = *pd;
         *pd = d;
-        d->next_hash = domain_hash[DOMAIN_HASH(dom_id)];
+        d->next_in_hashbucket = domain_hash[DOMAIN_HASH(dom_id)];
         domain_hash[DOMAIN_HASH(dom_id)] = d;
         write_unlock(&domlist_lock);
     }
@@ -94,7 +94,7 @@ struct domain *find_domain_by_id(domid_t dom)
                 d = NULL;
             break;
         }
-        d = d->next_hash;
+        d = d->next_in_hashbucket;
     }
     read_unlock(&domlist_lock);
 
@@ -107,7 +107,7 @@ void domain_kill(struct domain *d)
     struct exec_domain *ed;
 
     domain_pause(d);
-    if ( !test_and_set_bit(DF_DYING, &d->d_flags) )
+    if ( !test_and_set_bit(DF_DYING, &d->flags) )
     {
         for_each_exec_domain(d, ed)
             sched_rem_domain(ed);
@@ -124,7 +124,7 @@ void domain_crash(void)
     if ( d->id == 0 )
         BUG();
 
-    set_bit(DF_CRASHED, &d->d_flags);
+    set_bit(DF_CRASHED, &d->flags);
 
     send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC);
 
@@ -164,9 +164,9 @@ void domain_shutdown(u8 reason)
     }
 
     if ( (d->shutdown_code = reason) == SHUTDOWN_crash )
-        set_bit(DF_CRASHED, &d->d_flags);
+        set_bit(DF_CRASHED, &d->flags);
     else
-        set_bit(DF_SHUTDOWN, &d->d_flags);
+        set_bit(DF_SHUTDOWN, &d->flags);
 
     send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC);
 
@@ -180,7 +180,7 @@ void domain_destruct(struct domain *d)
     struct domain **pd;
     atomic_t      old, new;
 
-    if ( !test_bit(DF_DYING, &d->d_flags) )
+    if ( !test_bit(DF_DYING, &d->flags) )
         BUG();
 
     /* May be already destructed, or get_domain() can race us. */
@@ -194,12 +194,12 @@ void domain_destruct(struct domain *d)
     write_lock(&domlist_lock);
     pd = &domain_list;
     while ( *pd != d ) 
-        pd = &(*pd)->next_list;
-    *pd = d->next_list;
+        pd = &(*pd)->next_in_list;
+    *pd = d->next_in_list;
     pd = &domain_hash[DOMAIN_HASH(d->id)];
     while ( *pd != d ) 
-        pd = &(*pd)->next_hash;
-    *pd = d->next_hash;
+        pd = &(*pd)->next_in_hashbucket;
+    *pd = d->next_in_hashbucket;
     write_unlock(&domlist_lock);
 
     destroy_event_channels(d);
@@ -227,8 +227,8 @@ int set_info_guest(struct domain *p, dom0_setdomaininfo_t *setdomaininfo)
     if ( (vcpu >= MAX_VIRT_CPUS) || ((ed = p->exec_domain[vcpu]) == NULL) )
         return -EINVAL;
     
-    if (test_bit(DF_CONSTRUCTED, &p->d_flags) && 
-        !test_bit(EDF_CTRLPAUSE, &ed->ed_flags))
+    if (test_bit(DF_CONSTRUCTED, &p->flags) && 
+        !test_bit(EDF_CTRLPAUSE, &ed->flags))
         return -EINVAL;
 
     if ( (c = xmalloc(struct vcpu_guest_context)) == NULL )
@@ -243,7 +243,7 @@ int set_info_guest(struct domain *p, dom0_setdomaininfo_t *setdomaininfo)
     if ( (rc = arch_set_info_guest(ed, c)) != 0 )
         goto out;
 
-    set_bit(DF_CONSTRUCTED, &p->d_flags);
+    set_bit(DF_CONSTRUCTED, &p->flags);
 
  out:    
     xfree(c);
@@ -294,7 +294,7 @@ long do_boot_vcpu(unsigned long vcpu, struct vcpu_guest_context *ctxt)
     sched_add_domain(ed);
 
     /* domain_unpause_by_systemcontroller */
-    if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->ed_flags) )
+    if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->flags) )
         domain_wake(ed);
 
     xfree(c);
index b1ed16ac370d7dc124212e345daee1198520bf6f..22b01ad5417d56e4598e46a8a5e2f11b6ceb4d06 100644 (file)
@@ -40,7 +40,7 @@ static int get_free_port(struct exec_domain *ed)
     max = d->max_event_channel;
     chn = d->event_channel;
 
-    for ( port = ed->eid * EVENT_CHANNELS_SPREAD; port < max; port++ )
+    for ( port = ed->id * EVENT_CHANNELS_SPREAD; port < max; port++ )
         if ( chn[port].state == ECS_FREE )
             break;
 
index ca43f2f3c3b66327e47b234fc26b07d2bb64e146..3449143458f9c8a32fec5a0c6e29576b981459be 100644 (file)
@@ -109,7 +109,7 @@ static void do_task_queues(unsigned char key)
     for_each_domain ( d )
     {
         printk("Xen: DOM %u, flags=%lx refcnt=%d nr_pages=%d "
-               "xenheap_pages=%d\n", d->id, d->d_flags,
+               "xenheap_pages=%d\n", d->id, d->flags,
                atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages);
 
         dump_pageframe_info(d);
@@ -118,11 +118,11 @@ static void do_task_queues(unsigned char key)
             printk("Guest: %p CPU %d [has=%c] flags=%lx "
                    "upcall_pend = %02x, upcall_mask = %02x\n", ed,
                    ed->processor,
-                   test_bit(EDF_RUNNING, &ed->ed_flags) ? 'T':'F',
-                   ed->ed_flags,
+                   test_bit(EDF_RUNNING, &ed->flags) ? 'T':'F',
+                   ed->flags,
                    ed->vcpu_info->evtchn_upcall_pending, 
                    ed->vcpu_info->evtchn_upcall_mask);
-            printk("Notifying guest... %d/%d\n", d->id, ed->eid); 
+            printk("Notifying guest... %d/%d\n", d->id, ed->id); 
             printk("port %d/%d stat %d %d %d\n",
                    VIRQ_DEBUG, ed->virq_to_evtchn[VIRQ_DEBUG],
                    test_bit(ed->virq_to_evtchn[VIRQ_DEBUG], 
index 5573ced9572e28cc4f6629bd944ff2a6b2a741e2..fb26edc69cea03ca9e292bc9e5501b23fe300745 100644 (file)
@@ -503,13 +503,13 @@ struct pfn_info *alloc_domheap_pages(struct domain *d, unsigned int order)
 
     spin_lock(&d->page_alloc_lock);
 
-    if ( unlikely(test_bit(DF_DYING, &d->d_flags)) ||
+    if ( unlikely(test_bit(DF_DYING, &d->flags)) ||
          unlikely((d->tot_pages + (1 << order)) > d->max_pages) )
     {
         DPRINTK("Over-allocation for domain %u: %u > %u\n",
                 d->id, d->tot_pages + (1 << order), d->max_pages);
         DPRINTK("...or the domain is dying (%d)\n", 
-                !!test_bit(DF_DYING, &d->d_flags));
+                !!test_bit(DF_DYING, &d->flags));
         spin_unlock(&d->page_alloc_lock);
         free_heap_pages(MEMZONE_DOM, pg, order);
         return NULL;
@@ -574,7 +574,7 @@ void free_domheap_pages(struct pfn_info *pg, unsigned int order)
 
         spin_unlock_recursive(&d->page_alloc_lock);
 
-        if ( likely(!test_bit(DF_DYING, &d->d_flags)) )
+        if ( likely(!test_bit(DF_DYING, &d->flags)) )
         {
             free_heap_pages(MEMZONE_DOM, pg, order);
         }
index 65fa6125bff9b188c997e33d5da178c92c8b39bf..276479e490bf09530014c65221aedc4d5fb256ce 100644 (file)
@@ -59,7 +59,7 @@ struct bvt_cpu_info
 };
 
 #define BVT_INFO(p)   ((struct bvt_dom_info *)(p)->sched_priv)
-#define EBVT_INFO(p)  ((struct bvt_edom_info *)(p)->ed_sched_priv)
+#define EBVT_INFO(p)  ((struct bvt_edom_info *)(p)->sched_priv)
 #define CPU_INFO(cpu) ((struct bvt_cpu_info *)(schedule_data[cpu]).sched_priv)
 #define RUNLIST(p)    ((struct list_head *)&(EBVT_INFO(p)->run_list))
 #define RUNQUEUE(cpu) ((struct list_head *)&(CPU_INFO(cpu)->runqueue))
@@ -174,9 +174,9 @@ static int bvt_alloc_task(struct exec_domain *ed)
             return -1;
         memset(d->sched_priv, 0, sizeof(struct bvt_dom_info));
     }
-    ed->ed_sched_priv = &BVT_INFO(d)->ed_inf[ed->eid];
-    BVT_INFO(d)->ed_inf[ed->eid].inf = BVT_INFO(d);
-    BVT_INFO(d)->ed_inf[ed->eid].exec_domain = ed;
+    ed->sched_priv = &BVT_INFO(d)->ed_inf[ed->id];
+    BVT_INFO(d)->ed_inf[ed->id].inf = BVT_INFO(d);
+    BVT_INFO(d)->ed_inf[ed->id].exec_domain = ed;
     return 0;
 }
 
@@ -190,7 +190,7 @@ static void bvt_add_task(struct exec_domain *d)
     ASSERT(inf != NULL);
     ASSERT(d   != NULL);
 
-    if (d->eid == 0) {
+    if (d->id == 0) {
         inf->mcu_advance = MCU_ADVANCE;
         inf->domain      = d->domain;
         inf->warpback    = 0;
@@ -224,43 +224,43 @@ static void bvt_add_task(struct exec_domain *d)
     }
 }
 
-static int bvt_init_idle_task(struct exec_domain *p)
+static int bvt_init_idle_task(struct exec_domain *ed)
 {
-    if ( bvt_alloc_task(p) < 0 )
+    if ( bvt_alloc_task(ed) < 0 )
         return -1;
 
-    bvt_add_task(p);
+    bvt_add_task(ed);
+
+    set_bit(EDF_RUNNING, &ed->flags);
+    if ( !__task_on_runqueue(ed) )
+        __add_to_runqueue_head(ed);
 
-    set_bit(EDF_RUNNING, &p->ed_flags);
-    if ( !__task_on_runqueue(p) )
-        __add_to_runqueue_head(p);
-        
     return 0;
 }
 
-static void bvt_wake(struct exec_domain *d)
+static void bvt_wake(struct exec_domain *ed)
 {
-    struct bvt_edom_info *einf = EBVT_INFO(d);
+    struct bvt_edom_info *einf = EBVT_INFO(ed);
     struct exec_domain  *curr;
     s_time_t            now, r_time;
-    int                 cpu = d->processor;
+    int                 cpu = ed->processor;
     u32                 curr_evt;
 
-    if ( unlikely(__task_on_runqueue(d)) )
+    if ( unlikely(__task_on_runqueue(ed)) )
         return;
 
-    __add_to_runqueue_head(d);
+    __add_to_runqueue_head(ed);
 
     now = NOW();
 
     /* Set the BVT parameters. AVT should always be updated 
        if CPU migration ocurred.*/
     if ( einf->avt < CPU_SVT(cpu) || 
-         unlikely(test_bit(EDF_MIGRATED, &d->ed_flags)) )
+         unlikely(test_bit(EDF_MIGRATED, &ed->flags)) )
         einf->avt = CPU_SVT(cpu);
 
     /* Deal with warping here. */
-    einf->evt = calc_evt(d, einf->avt);
+    einf->evt = calc_evt(ed, einf->avt);
     
     curr = schedule_data[cpu].curr;
     curr_evt = calc_evt(curr, calc_avt(curr, now));
@@ -277,12 +277,12 @@ static void bvt_wake(struct exec_domain *d)
 }
 
 
-static void bvt_sleep(struct exec_domain *d)
+static void bvt_sleep(struct exec_domain *ed)
 {
-    if ( test_bit(EDF_RUNNING, &d->ed_flags) )
-        cpu_raise_softirq(d->processor, SCHEDULE_SOFTIRQ);
-    else  if ( __task_on_runqueue(d) )
-        __del_from_runqueue(d);
+    if ( test_bit(EDF_RUNNING, &ed->flags) )
+        cpu_raise_softirq(ed->processor, SCHEDULE_SOFTIRQ);
+    else  if ( __task_on_runqueue(ed) )
+        __del_from_runqueue(ed);
 }
 
 /**
@@ -377,7 +377,7 @@ static struct task_slice bvt_do_schedule(s_time_t now)
     struct bvt_edom_info *next_prime_einf = NULL;
     struct task_slice     ret;
 
-    ASSERT(prev->ed_sched_priv != NULL);
+    ASSERT(prev->sched_priv != NULL);
     ASSERT(prev_einf != NULL);
     ASSERT(__task_on_runqueue(prev));
 
@@ -526,8 +526,8 @@ static void bvt_dump_cpu_state(int i)
 {
     struct list_head *queue;
     int loop = 0;
-    struct bvt_edom_info *d_inf;
-    struct exec_domain *d;
+    struct bvt_edom_info *ed_inf;
+    struct exec_domain *ed;
     
     printk("svt=0x%08lX ", CPU_SVT(i));
 
@@ -535,15 +535,15 @@ static void bvt_dump_cpu_state(int i)
     printk("QUEUE rq %lx   n: %lx, p: %lx\n",  (unsigned long)queue,
            (unsigned long) queue->next, (unsigned long) queue->prev);
 
-    list_for_each_entry ( d_inf, queue, run_list )
+    list_for_each_entry ( ed_inf, queue, run_list )
     {
-        d = d_inf->exec_domain;
-        printk("%3d: %u has=%c ", loop++, d->domain->id,
-               test_bit(EDF_RUNNING, &d->ed_flags) ? 'T':'F');
-        bvt_dump_runq_el(d);
-        printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time);
+        ed = ed_inf->exec_domain;
+        printk("%3d: %u has=%c ", loop++, ed->domain->id,
+               test_bit(EDF_RUNNING, &ed->flags) ? 'T':'F');
+        bvt_dump_runq_el(ed);
+        printk("c=0x%X%08X\n", (u32)(ed->cpu_time>>32), (u32)ed->cpu_time);
         printk("         l: %p n: %p  p: %p\n",
-               &d_inf->run_list, d_inf->run_list.next, d_inf->run_list.prev);
+               &ed_inf->run_list, ed_inf->run_list.next, ed_inf->run_list.prev);
     }
 }
 
index 4123231dd1b788a8d4d289191b7075b333265ba7..b08e09094c7cd0d78565864c301101e957408010 100644 (file)
@@ -93,24 +93,27 @@ struct exec_domain *alloc_exec_domain_struct(struct domain *d,
 
     d->exec_domain[vcpu] = ed;
     ed->domain = d;
-    ed->eid = vcpu;
+    ed->id = vcpu;
 
     if ( SCHED_OP(alloc_task, ed) < 0 )
         goto out;
 
-    if (vcpu != 0) {
-        ed->vcpu_info = &d->shared_info->vcpu_data[ed->eid];
+    if ( vcpu != 0 )
+    {
+        ed->vcpu_info = &d->shared_info->vcpu_data[ed->id];
 
-        for_each_exec_domain(d, edc) {
-            if (edc->ed_next_list == NULL || edc->ed_next_list->eid > vcpu)
+        for_each_exec_domain( d, edc )
+        {
+            if ( (edc->next_in_list == NULL) ||
+                 (edc->next_in_list->id > vcpu) )
                 break;
         }
-        ed->ed_next_list = edc->ed_next_list;
-        edc->ed_next_list = ed;
+        ed->next_in_list  = edc->next_in_list;
+        edc->next_in_list = ed;
 
-        if (test_bit(EDF_CPUPINNED, &edc->ed_flags)) {
+        if (test_bit(EDF_CPUPINNED, &edc->flags)) {
             ed->processor = (edc->processor + 1) % smp_num_cpus;
-            set_bit(EDF_CPUPINNED, &ed->ed_flags);
+            set_bit(EDF_CPUPINNED, &ed->flags);
         } else {
             ed->processor = (edc->processor + 1) % smp_num_cpus;  /* XXX */
         }
@@ -152,7 +155,7 @@ void sched_add_domain(struct exec_domain *ed)
     struct domain *d = ed->domain;
 
     /* Must be unpaused by control software to start execution. */
-    set_bit(EDF_CTRLPAUSE, &ed->ed_flags);
+    set_bit(EDF_CTRLPAUSE, &ed->flags);
 
     if ( d->id != IDLE_DOMAIN_ID )
     {
@@ -168,14 +171,14 @@ void sched_add_domain(struct exec_domain *ed)
     }
 
     SCHED_OP(add_task, ed);
-    TRACE_2D(TRC_SCHED_DOM_ADD, d->id, ed->eid);
+    TRACE_2D(TRC_SCHED_DOM_ADD, d->id, ed->id);
 }
 
 void sched_rem_domain(struct exec_domain *ed) 
 {
     rem_ac_timer(&ed->timer);
     SCHED_OP(rem_task, ed);
-    TRACE_2D(TRC_SCHED_DOM_REM, ed->domain->id, ed->eid);
+    TRACE_2D(TRC_SCHED_DOM_REM, ed->domain->id, ed->id);
 }
 
 void init_idle_task(void)
@@ -193,10 +196,10 @@ void domain_sleep(struct exec_domain *ed)
         SCHED_OP(sleep, ed);
     spin_unlock_irqrestore(&schedule_data[ed->processor].schedule_lock, flags);
 
-    TRACE_2D(TRC_SCHED_SLEEP, ed->domain->id, ed->eid);
+    TRACE_2D(TRC_SCHED_SLEEP, ed->domain->id, ed->id);
  
     /* Synchronous. */
-    while ( test_bit(EDF_RUNNING, &ed->ed_flags) && !domain_runnable(ed) )
+    while ( test_bit(EDF_RUNNING, &ed->flags) && !domain_runnable(ed) )
         cpu_relax();
 }
 
@@ -212,10 +215,10 @@ void domain_wake(struct exec_domain *ed)
         ed->wokenup = NOW();
 #endif
     }
-    clear_bit(EDF_MIGRATED, &ed->ed_flags);
+    clear_bit(EDF_MIGRATED, &ed->flags);
     spin_unlock_irqrestore(&schedule_data[ed->processor].schedule_lock, flags);
 
-    TRACE_2D(TRC_SCHED_WAKE, ed->domain->id, ed->eid);
+    TRACE_2D(TRC_SCHED_WAKE, ed->domain->id, ed->id);
 }
 
 /* Block the currently-executing domain until a pertinent event occurs. */
@@ -224,16 +227,16 @@ long do_block(void)
     struct exec_domain *ed = current;
 
     ed->vcpu_info->evtchn_upcall_mask = 0;
-    set_bit(EDF_BLOCKED, &ed->ed_flags);
+    set_bit(EDF_BLOCKED, &ed->flags);
 
     /* Check for events /after/ blocking: avoids wakeup waiting race. */
     if ( event_pending(ed) )
     {
-        clear_bit(EDF_BLOCKED, &ed->ed_flags);
+        clear_bit(EDF_BLOCKED, &ed->flags);
     }
     else
     {
-        TRACE_2D(TRC_SCHED_BLOCK, ed->domain->id, ed->eid);
+        TRACE_2D(TRC_SCHED_BLOCK, ed->domain->id, ed->id);
         __enter_scheduler();
     }
 
@@ -243,7 +246,7 @@ long do_block(void)
 /* Voluntarily yield the processor for this allocation. */
 static long do_yield(void)
 {
-    TRACE_2D(TRC_SCHED_YIELD, current->domain->id, current->eid);
+    TRACE_2D(TRC_SCHED_YIELD, current->domain->id, current->id);
     __enter_scheduler();
     return 0;
 }
@@ -272,7 +275,7 @@ long do_sched_op(unsigned long op)
 
     case SCHEDOP_shutdown:
     {
-        TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->id, current->eid,
+        TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->id, current->id,
                  (op >> SCHEDOP_reasonshift));
         domain_shutdown((u8)(op >> SCHEDOP_reasonshift));
         break;
@@ -379,7 +382,7 @@ static void __enter_scheduler(void)
     add_ac_timer(&schedule_data[cpu].s_timer);
 
     /* Must be protected by the schedule_lock! */
-    set_bit(EDF_RUNNING, &next->ed_flags);
+    set_bit(EDF_RUNNING, &next->flags);
 
     spin_unlock_irq(&schedule_data[cpu].schedule_lock);
 
@@ -417,8 +420,8 @@ static void __enter_scheduler(void)
     }
 
     TRACE_4D(TRC_SCHED_SWITCH,
-             prev->domain->id, prev->eid,
-             next->domain->id, next->eid);
+             prev->domain->id, prev->id,
+             next->domain->id, next->id);
 
     context_switch(prev, next);
 }
index fabe304155e0e0a37c9a4d5c8aadfd86946aa2e9..7f44c5ae871402f45f56859af5bf9985f654be69 100644 (file)
@@ -271,9 +271,9 @@ extern unsigned long _end; /* standard ELF symbol */
 extern unsigned long xenheap_phys_end; /* user-configurable */
 #endif
 
-#define GDT_VIRT_START(ed)    (PERDOMAIN_VIRT_START + ((ed)->eid << PDPT_VCPU_VA_SHIFT))
+#define GDT_VIRT_START(ed)    (PERDOMAIN_VIRT_START + ((ed)->id << PDPT_VCPU_VA_SHIFT))
 #define GDT_VIRT_END(ed)      (GDT_VIRT_START(ed) + (64*1024))
-#define LDT_VIRT_START(ed)    (PERDOMAIN_VIRT_START + (64*1024) + ((ed)->eid << PDPT_VCPU_VA_SHIFT))
+#define LDT_VIRT_START(ed)    (PERDOMAIN_VIRT_START + (64*1024) + ((ed)->id << PDPT_VCPU_VA_SHIFT))
 #define LDT_VIRT_END(ed)      (LDT_VIRT_START(ed) + (64*1024))
 
 #define PDPT_VCPU_SHIFT       5
index 0d6221a25e4340223f4ad7b19b0eb85e08ee43e8..6e9cf223d5452c4c0ff8918a799370e7f262cf5d 100644 (file)
@@ -69,7 +69,7 @@ static inline int debugger_trap_entry(
     {
     case TRAP_int3:
     case TRAP_debug:
-        set_bit(EDF_CTRLPAUSE, &ed->ed_flags);
+        set_bit(EDF_CTRLPAUSE, &ed->flags);
         raise_softirq(SCHEDULE_SOFTIRQ);
         return 1;
     }
index 9f6bb78b90b219a0f2fa5152731f910aa6610ec4..ca81778089b67407c5ae78a124468a59256fce04 100644 (file)
@@ -19,7 +19,7 @@ extern void save_init_fpu(struct exec_domain *tsk);
 extern void restore_fpu(struct exec_domain *tsk);
 
 #define unlazy_fpu(_tsk) do { \
-    if ( test_bit(EDF_USEDFPU, &(_tsk)->ed_flags) ) \
+    if ( test_bit(EDF_USEDFPU, &(_tsk)->flags) ) \
         save_init_fpu(_tsk); \
 } while ( 0 )
 
index f0f3d61fd65ac163610f1fd7c68d9b1eba3c4abf..ac7ce6b1a0440af5b6ce21db7baa678f03b68784 100644 (file)
@@ -43,7 +43,7 @@ static inline void evtchn_set_pending(struct exec_domain *ed, int port)
          * NB2. We save DF_RUNNING across the unblock to avoid a needless
          * IPI for domains that we IPI'd to unblock.
          */
-        running = test_bit(EDF_RUNNING, &ed->ed_flags);
+        running = test_bit(EDF_RUNNING, &ed->flags);
         exec_domain_unblock(ed);
         if ( running )
             smp_send_event_check_cpu(ed->processor);
index 266e34e8ecabbdded2a1c1d8c7d709fa21892f97..6f64e0c05705001c45f9c4838f60b9ed4ab3bcc4 100644 (file)
@@ -60,13 +60,14 @@ int  init_exec_domain_event_channels(struct exec_domain *ed);
 
 struct exec_domain 
 {
-    u32 processor;
+    int              id;
 
-    vcpu_info_t *vcpu_info;
+    int              processor;
 
-    struct domain *domain;
-    struct exec_domain *ed_next_list;
-    int eid;
+    vcpu_info_t     *vcpu_info;
+
+    struct domain   *domain;
+    struct exec_domain *next_in_list;
 
     struct ac_timer  timer;         /* one-shot timer for timeout values */
     unsigned long    sleep_tick;    /* tick at which this vcpu started sleep */
@@ -75,13 +76,13 @@ struct exec_domain
     s_time_t         lastdeschd;    /* time this domain was last descheduled */
     s_time_t         cpu_time;      /* total CPU time received till now */
     s_time_t         wokenup;       /* time domain got woken up */
-    void            *ed_sched_priv;    /* scheduler-specific data */
+    void            *sched_priv;    /* scheduler-specific data */
 
-    unsigned long ed_flags;
+    unsigned long    flags;
 
-    u16 virq_to_evtchn[NR_VIRQS];
+    u16              virq_to_evtchn[NR_VIRQS];
 
-    atomic_t pausecnt;
+    atomic_t         pausecnt;
 
     struct arch_exec_domain arch;
 };
@@ -111,14 +112,15 @@ struct domain
     int              shutdown_code; /* code value from OS (if DF_SHUTDOWN). */
     void            *sched_priv;    /* scheduler-specific data */
 
-    struct domain *next_list, *next_hash;
+    struct domain   *next_in_list;
+    struct domain   *next_in_hashbucket;
 
     /* Event channel information. */
     event_channel_t *event_channel;
     unsigned int     max_event_channel;
     spinlock_t       event_channel_lock;
 
-    grant_table_t *grant_table;
+    grant_table_t   *grant_table;
 
     /*
      * Interrupt to event-channel mappings. Updates should be protected by the 
@@ -126,13 +128,13 @@ struct domain
      * the lock, but races don't usually matter.
      */
 #define NR_PIRQS 128 /* Put this somewhere sane! */
-    u16 pirq_to_evtchn[NR_PIRQS];
-    u32 pirq_mask[NR_PIRQS/32];
+    u16              pirq_to_evtchn[NR_PIRQS];
+    u32              pirq_mask[NR_PIRQS/32];
 
-    unsigned long d_flags;
-    unsigned long vm_assist;
+    unsigned long    flags;
+    unsigned long    vm_assist;
 
-    atomic_t refcnt;
+    atomic_t         refcnt;
 
     struct exec_domain *exec_domain[MAX_VIRT_CPUS];
 
@@ -166,7 +168,7 @@ extern struct exec_domain idle0_exec_domain;
 
 extern struct exec_domain *idle_task[NR_CPUS];
 #define IDLE_DOMAIN_ID   (0x7FFFU)
-#define is_idle_task(_p) (test_bit(DF_IDLETASK, &(_p)->d_flags))
+#define is_idle_task(_p) (test_bit(DF_IDLETASK, &(_p)->flags))
 
 struct exec_domain *alloc_exec_domain_struct(struct domain *d,
                                              unsigned long vcpu);
@@ -315,35 +317,36 @@ extern struct domain *domain_hash[DOMAIN_HASH_SIZE];
 extern struct domain *domain_list;
 
 #define for_each_domain(_d) \
- for ( (_d) = domain_list; (_d) != NULL; (_d) = (_d)->next_list )
+ for ( (_d) = domain_list; (_d) != NULL; (_d) = (_d)->next_in_list )
 
 #define for_each_exec_domain(_d,_ed) \
  for ( (_ed) = (_d)->exec_domain[0]; \
        (_ed) != NULL;                \
-       (_ed) = (_ed)->ed_next_list )
+       (_ed) = (_ed)->next_in_list )
 
 #define EDF_DONEFPUINIT  0 /* Has the FPU been initialised for this task?    */
 #define EDF_USEDFPU      1 /* Has this task used the FPU since last save?    */
 #define EDF_GUEST_STTS   2 /* Has the guest OS requested 'stts'?             */
-#define  DF_CONSTRUCTED  3 /* Has the guest OS been fully built yet?         */
-#define  DF_IDLETASK     4 /* Is this one of the per-CPU idle domains?       */
-#define  DF_PRIVILEGED   5 /* Is this domain privileged?                     */
-#define  DF_PHYSDEV      6 /* May this domain do IO to physical devices?     */
-#define EDF_BLOCKED      7 /* Domain is blocked waiting for an event.        */
-#define EDF_CTRLPAUSE    8 /* Domain is paused by controller software.       */
-#define  DF_SHUTDOWN     9 /* Guest shut itself down for some reason.        */
-#define  DF_CRASHED     10 /* Domain crashed inside Xen, cannot continue.    */
-#define  DF_DYING       11 /* Death rattle.                                  */
-#define EDF_RUNNING     12 /* Currently running on a CPU.                    */
-#define EDF_CPUPINNED   13 /* Disables auto-migration.                       */
-#define EDF_MIGRATED    14 /* Domain migrated between CPUs.                  */
-#define EDF_DONEINIT    15 /* Initialization completed    .                  */
-
-static inline int domain_runnable(struct exec_domain *d)
+#define EDF_BLOCKED      3 /* Domain is blocked waiting for an event.        */
+#define EDF_CTRLPAUSE    4 /* Domain is paused by controller software.       */
+#define EDF_RUNNING      5 /* Currently running on a CPU.                    */
+#define EDF_CPUPINNED    6 /* Disables auto-migration.                       */
+#define EDF_MIGRATED     7 /* Domain migrated between CPUs.                  */
+#define EDF_DONEINIT     8 /* Initialization completed    .                  */
+
+#define DF_CONSTRUCTED   0 /* Has the guest OS been fully built yet?         */
+#define DF_IDLETASK      1 /* Is this one of the per-CPU idle domains?       */
+#define DF_PRIVILEGED    2 /* Is this domain privileged?                     */
+#define DF_PHYSDEV       3 /* May this domain do IO to physical devices?     */
+#define DF_SHUTDOWN      4 /* Guest shut itself down for some reason.        */
+#define DF_CRASHED       5 /* Domain crashed inside Xen, cannot continue.    */
+#define DF_DYING         6 /* Death rattle.                                  */
+
+static inline int domain_runnable(struct exec_domain *ed)
 {
-    return ( (atomic_read(&d->pausecnt) == 0) &&
-             !(d->ed_flags & ((1<<EDF_BLOCKED)|(1<<EDF_CTRLPAUSE))) &&
-             !(d->domain->d_flags & ((1<<DF_SHUTDOWN)|(1<<DF_CRASHED))) );
+    return ( (atomic_read(&ed->pausecnt) == 0) &&
+             !(ed->flags & ((1<<EDF_BLOCKED)|(1<<EDF_CTRLPAUSE))) &&
+             !(ed->domain->flags & ((1<<DF_SHUTDOWN)|(1<<DF_CRASHED))) );
 }
 
 static inline void exec_domain_pause(struct exec_domain *ed)
@@ -385,7 +388,7 @@ static inline void domain_unpause(struct domain *d)
 
 static inline void exec_domain_unblock(struct exec_domain *ed)
 {
-    if ( test_and_clear_bit(EDF_BLOCKED, &ed->ed_flags) )
+    if ( test_and_clear_bit(EDF_BLOCKED, &ed->flags) )
         domain_wake(ed);
 }
 
@@ -396,7 +399,7 @@ static inline void domain_pause_by_systemcontroller(struct domain *d)
     for_each_exec_domain ( d, ed )
     {
         ASSERT(ed != current);
-        if ( !test_and_set_bit(EDF_CTRLPAUSE, &ed->ed_flags) )
+        if ( !test_and_set_bit(EDF_CTRLPAUSE, &ed->flags) )
             domain_sleep(ed);
     }
 
@@ -409,14 +412,14 @@ static inline void domain_unpause_by_systemcontroller(struct domain *d)
 
     for_each_exec_domain ( d, ed )
     {
-        if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->ed_flags) )
+        if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->flags) )
             domain_wake(ed);
     }
 }
 
 
-#define IS_PRIV(_d) (test_bit(DF_PRIVILEGED, &(_d)->d_flags))
-#define IS_CAPABLE_PHYSDEV(_d) (test_bit(DF_PHYSDEV, &(_d)->d_flags))
+#define IS_PRIV(_d) (test_bit(DF_PRIVILEGED, &(_d)->flags))
+#define IS_CAPABLE_PHYSDEV(_d) (test_bit(DF_PHYSDEV, &(_d)->flags))
 
 #define VM_ASSIST(_d,_t) (test_bit((_t), &(_d)->vm_assist))